<%@ page language="java" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<title></title>
<base href="${base}/manager/" />
<link rel="stylesheet" href="css/pintuer.css">
<link rel="stylesheet" href="css/admin.css">
</head>
<script src="js/jquery-3.5.0.js"></script>
<script src="layer/layer.js"></script>
<script>
	function tolist(){
		location.href="GoodsServelet?opr=query";
	}
	let success = "${success}";
	if(success!=""){
		layer.alert(success);
	}
	let nocategory="${nocategory}" ;
	if(nocategory){
		layer.confirm(nocategory,{
			btn:["朕要前往添加","朕就在本处看看"]
		},function(){
			location.href = "category/category_add.jsp";
		},function(){
			return;
		});
	}
</script>

<body>
	<div class="panel admin-panel">
		<div class="panel-head" id="add">
			<strong><span class="icon-pencil-square-o"></span>增加商品</strong>
		</div>
		<div class="padding border-bottom">
		<button type="button" class="button border-yellow" onclick='tolist()'>
				<span class="icon-plus-square-o"></span>查看商品
		</button>
		</div>
		<div class="body-content">
			<form method="post" class="form-x" action="GoodsServelet"
				enctype="multipart/form-data">
				<input type="hidden" name="opr" value="add" />
				<div class="form-group">
					<div class="label">
						<label>商品名称：</label>
					</div>
					<div class="field">
						<input type="text" class="input" name="name" value="" />
						<div class="tips">${msg}</div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>商品类别：</label>
					</div>
					<div class="field">
						<select name="choosecategory" class="input w50">
							<option value="0">请选择商品类别</option>
							<c:forEach items="${categories}" var="category">
								<option value="${category.id}">${category.name}</option>
							</c:forEach>
						</select>
						<div class="tips"></div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>库存：</label>
					</div>
					<div class="field">
						<input type="text" class="input w50" name="stock" value="" />
						<div class="tips">${msg2}</div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>市场价：</label>
					</div>
					<div class="field">
						<input type="text" class="input w50" name="marketprice" value="" />
						<div class="tips">${msg3}</div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>销售价：</label>
					</div>
					<div class="field">
						<input type="text" class="input w50" name="saleprice" value="" />
						<div class="tips">${msg4}</div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>图片：</label>
					</div>
					<div class="field">
						<input type="file" class="input w50" name="image" />
						<div class="tips">${msg5}</div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>描述：</label>
					</div>
					<div class="field">
						<!-- 加载编辑器的容器 -->
						<script id="container" name="content" type="text/plain">
       						说点啥？
    					</script>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label></label>
					</div>
					<div class="field">
						<button class="button bg-main icon-check-square-o" type="submit">
							提交</button>
					</div>
				</div>
			</form>
		</div>
	</div>
</body>

<!-- 配置文件 -->
<script type="text/javascript" src="ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="ueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
	var ue = UE.getEditor('container');
</script>

</html>